package com.demo.security.expression;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.FilterInvocation;
import org.springframework.security.web.access.expression.WebSecurityExpressionRoot;

public class OpcnetWebSecurityExpressionRoot extends WebSecurityExpressionRoot implements
        OpcnetSecurityExpressionOperations {

    public OpcnetWebSecurityExpressionRoot(Authentication a, FilterInvocation fi) {
        super(a, fi);
    }

    public boolean hasAnyPermission(Object... targets) {
        for (Object target : targets) {
            if (super.hasPermission(target, read)) {
                return true;
            }
        }
        return false;
    }

    public boolean hasPermission(Object target) {
        return super.hasPermission(target, read);
    }

}
